/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package it.polimi.wcalendar.business.security.entity;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 *
 * @author gugu
 */
@Embeddable
public class PeopleInvitedPK implements Serializable {
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 15)
    @Column(name = "Id_usr")
    private String idusr;
    @Basic(optional = false)
    @NotNull
    @Column(name = "Id_e")
    private int ide;

    public PeopleInvitedPK() {
    }

    public PeopleInvitedPK(String idusr, int ide) {
        this.idusr = idusr;
        this.ide = ide;
    }

    public String getIdusr() {
        return idusr;
    }

    public void setIdusr(String idusr) {
        this.idusr = idusr;
    }

    public int getIde() {
        return ide;
    }

    public void setIde(int ide) {
        this.ide = ide;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idusr != null ? idusr.hashCode() : 0);
        hash += (int) ide;
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof PeopleInvitedPK)) {
            return false;
        }
        PeopleInvitedPK other = (PeopleInvitedPK) object;
        if ((this.idusr == null && other.idusr != null) || (this.idusr != null && !this.idusr.equals(other.idusr))) {
            return false;
        }
        if (this.ide != other.ide) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "it.polimi.wcalendar.business.security.PeopleInvitedPK[ idusr=" + idusr + ", ide=" + ide + " ]";
    }
    
}
